import sun.org.mozilla.javascript.internal.ast.CatchClause;

import java.util.Calendar;

/**
 * @author Jerry
 * @Description
 * @date 2016-10-06
 */
public class ClassStudy {
    public static void main(String[] args) {
        Class a = ClassStudy.class;

        ClassStudy b = new ClassStudy();
        Class c = b.getClass();


        try {
            Class d = Class.forName("java.ClassStudy");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        Class c1 = foo.class;
        try {
            foo foo = (foo) c1.newInstance();
            foo.print();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        foo foo = new foo();
        foo.print();

        foo foo1 = new foo();
        Class d1 = foo1.getClass();

    }
}

class foo {
    public void print() {
        System.out.println("nihao a");
    }
}
